package com.bosssoft.ct.springcloud.controller;

import com.bosssoft.ct.springcloud.service.UserFeignService;
import com.bosssoft.ct.springcloud.utils.http.HttpResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 消费Hystrix降低熔断逻辑控制器 只为测试用
 * @author ChenTong
 * @version 1.0
 * @date 2020/6/22 21:54
 * @copyright
 * @modified
 * @see
 * @since
 **/
@RestController
@Slf4j
public class HystrixTestController {

    @Resource
    private UserFeignService userFeignService;

    @GetMapping("/consumer/test/ok")
    public HttpResult ok(){
        return userFeignService.ok();
    }

    @GetMapping("/consumer/test/timeout")
    public HttpResult timeout(){
        return userFeignService.testTimeout();
    }

    @GetMapping("/consumer/test/error")
    public HttpResult error(){
        return userFeignService.error();
    }
}
